﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using XingLucifer.IBase;

namespace XingLucifer.Devices.Devices
{
    public class SpotWelderDrv : IDevices
    {
        private ICommunication _com;
        //private byte[] _start = Encoding.ASCII.GetBytes("LON\r\n");
        //private byte[] _end = Encoding.ASCII.GetBytes("LOFF\r\n");
        private CancellationTokenSource _token;
        public SpotWelderDrv(ICommunication com, CancellationTokenSource token)
        {
            _com = com;
            _token = token;
        }

        public Dictionary<string, string> CircuitTesterReceive()
        {
            throw new NotImplementedException();
        }

        public void Close() => _com.Close();

        public bool Open() => _com.Open();

        public string Read()
        {
            return _com.Read();
        }

        public List<ushort> Read(string addr, int count)
        {
            throw new NotImplementedException();
        }

        public bool ReadAndReturnBit(string addr)
        {
            throw new NotImplementedException();
        }

        public TClass ReadClass<TClass>(int address, TClass obj = null, int count = 3) where TClass : class
        {
            throw new NotImplementedException("未实现");
        }

        public TValue ReadSingle<TValue>(int address, int length, int count = 1)
        {
            return default;
        }

        public string ReadString(string addr, int count)
        {
            throw new NotImplementedException();
        }

        public bool Write<T>(string addr, T[] values)
        {
            throw new NotImplementedException();
        }

        public bool WriteClass<TClass>(TClass value, int address, int count = 3) where TClass : class
        {
            throw new NotImplementedException("未实现");
        }

        public bool WriteSingle(object value, int address, int offset, int length, int count = 3)
        {
            throw new NotImplementedException("未实现");
        }

        public bool WriteString(string addr, string values)
        {
            throw new NotImplementedException();
        }

        public bool WriteStringAsUInt16(string addr, string values)
        {
            throw new NotImplementedException();
        }
    }
}
